/*****************************************************************************************
This file is a part of Arise library.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

Arise Engine		LightSource.cpp

					E-mail:		arise_engine@mail.ru

created:			18.03.2008
last changes:		27.03.2008
*****************************************************************************************/
#include "stdafx.h"


LightSource::LightSource()
{
	m_type				= LIGHT_TYPE_UNKNOWN;
	m_intensity			= 0;
	m_hotspot			= 0;
	m_fall_off			= 0;
	m_attenuation_start	= 0;
	m_attenuation_end	= 0;
	m_aspect			= 0;
	m_target_dist		= 0;
}
LightSource::~LightSource()
{
}


void LightSource::Dump()
{
	UINT color = 4;
	log(color, "---------------------------------------");
	log(6, "LightSource %s", GetNameCStr());
	log(color, "---------------------------------------");
	m_transformation_node.Dump(4);
	if(m_type == LIGHT_TYPE_TARGET_DIRECT || m_type == LIGHT_TYPE_TARGET_SPOT)
		log_vector3(6, "target", m_target);
	switch(m_type)
	{
	default:
	case LIGHT_TYPE_UNKNOWN:		log(color, "type LIGHT_TYPE_UNKNOWN"); break;
	case LIGHT_TYPE_TARGET_SPOT:	log(color, "type LIGHT_TYPE_TARGET_SPOT"); break;
	case LIGHT_TYPE_TARGET_DIRECT:	log(color, "type LIGHT_TYPE_TARGET_DIRECT"); break;
	case LIGHT_TYPE_OMNI:			log(color, "type LIGHT_TYPE_OMNI"); break;
	case LIGHT_TYPE_FREE_SPOT:		log(color, "type LIGHT_TYPE_FREE_SPOT"); break;
	case LIGHT_TYPE_FREE_DIRECT:	log(color, "type LIGHT_TYPE_FREE_DIRECT"); break;
	}
	log_vector3(color, "color", m_color);
	log(color, "intensity %f", m_intensity);
	log(color, "hotspot %f", m_hotspot);
	log(color, "fall_off %f", m_fall_off);
	log(color, "attenuation_start %f", m_attenuation_start);
	log(color, "attenuation_end %f", m_attenuation_end);
	log(color, "aspect %f", m_aspect);
	log(color, "target_dist %f", m_target_dist);
	log(color, "---------------------------------------");
}